﻿using System;

namespace Script.Scene.Msg
{
    /// <summary>
    /// 切换场景需要的消息类
    /// </summary>
    public class LoadSceneMsg
    {
        public readonly int SceneBuildIndex;
        public readonly string SceneBuildName;
        public readonly Action OnSceneLoaded;


        public LoadSceneMsg()
        {
            SceneBuildIndex = -1;
            SceneBuildName = null;
            OnSceneLoaded = null;
        }


        public LoadSceneMsg(string name, Action loaded)
        {
            SceneBuildIndex = -1;
            SceneBuildName = name;
            OnSceneLoaded = loaded;
        }

        public LoadSceneMsg(int index, Action loaded)
        {
            SceneBuildIndex = index;
            SceneBuildName = null;
            OnSceneLoaded = loaded;
        }
    }
}